package pojo.dao.impl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import javax.print.attribute.standard.PDLOverrideSupported;

import pojo.Book;
import pojo.User;
import pojo.dao.PojoDao;
import pojo.dao.manager.impl.PojoDaoManagerFactory;

public class Test {

	private static Connection connection=createConnection();
	private static PojoDao pd=PojoDaoManagerFactory.getInstanceDao();
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
//		User user=new User(null,"angers1","123");
//		boolean u=pd.findUser(user, connection);
//               System.out.println(u);
               
               for(int i=1;i<=15;i++)
               {
            	   System.out.println("http://localhost:8080/ShoppingCart/imagine/headPortrait"+i+".jpg");
               }
//		List<Book> list=pd.findBooks(connection);
//		for(int i=0;i<list.size();i++)
//		{
//			System.out.println(list.get(i).getBookname());
//			System.out.println(list.get(i).getBookpath());
//		}
		
	}
	public static Connection createConnection(){
		String classname="oracle.jdbc.OracleDriver";
		String url="jdbc:oracle:thin:@ZHA-ITA077-w7:1521:ita3";
//		String url="jdbc:oracle:thin:@localhost:1521:orcl";
		String usernameString="angers";
		String password="123";
//		String password="angers";
		Connection connection=null;
		try {
			Class.forName(classname);
			connection= DriverManager.getConnection(url,usernameString,password);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		System.out.println(connection);
		return connection;
	}
	

}
